#include <helpers\math\matrix.h>

namespace DelGE
{
	namespace Helpers
	{
		namespace Math
		{
			Matrix::Matrix()
			{
				(*this)(0, 0) = 1; (*this)(1, 0) = 0; (*this)(2, 0) = 0; (*this)(3, 0) = 0;
				(*this)(0, 1) = 0; (*this)(1, 1) = 1; (*this)(2, 1) = 0; (*this)(3, 1) = 0;
				(*this)(0, 2) = 0; (*this)(1, 2) = 0; (*this)(2, 2) = 1; (*this)(3, 2) = 0;
				(*this)(0, 3) = 0; (*this)(1, 3) = 0; (*this)(2, 3) = 0; (*this)(3, 3) = 1;
			}

			Matrix::Matrix(const Matrix &rOther)
			{
				for (unsigned int i = 0; i < 16; i ++)
					(*this)[i] = rOther[i];
			}

			Matrix::~Matrix()
			{
				for (unsigned int i = 0; i < 16; i ++)
					(*this)[i] = 0;
			}
			
			Matrix Matrix::Identity()
			{
				Matrix identityMatrix;

				identityMatrix(0, 0) = 1; identityMatrix(1, 0) = 0; identityMatrix(2, 0) = 0; identityMatrix(3, 0) = 0;
				identityMatrix(0, 1) = 0; identityMatrix(1, 1) = 1; identityMatrix(2, 1) = 0; identityMatrix(3, 1) = 0;
				identityMatrix(0, 2) = 0; identityMatrix(1, 2) = 0; identityMatrix(2, 2) = 1; identityMatrix(3, 2) = 0;
				identityMatrix(0, 3) = 0; identityMatrix(1, 3) = 0; identityMatrix(2, 3) = 0; identityMatrix(3, 3) = 1;

				return identityMatrix;
			}

			
		}
	}
}